package DataStructure;

/**
 * Created by dell on 2017/5/20.
 */
public class TriElement { //二叉树静态链表存储哈夫曼树
    int data;      //数据域，表示权值
    int parent, left, right;  //父母结点和左右孩子结点下标

    public TriElement(int data, int parent, int left, int right) {
        this.data = data;
        this.parent = parent;
        this.left = left;
        this.right = right;
    }
    public TriElement(int data) {
        this(data, -1, -1, -1);
    }
    public TriElement() {
        this(0);
    }

    @Override
    public String toString() {
        return " " + data + "\t\t" +" " + parent + "\t\t" +" " + left + "\t\t" + " " + right ;
    }
}
